package com.example.telesys.config;

import com.example.telesys.interceptor.JWTInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class InterceptorWebConfig implements WebMvcConfigurer {

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        // addPathPatterns拦截所有请求 excludePathPatterns排除特殊的请求
//        registry.addInterceptor(new JWTInterceptor())
//                .addPathPatterns("/**")
//                .excludePathPatterns("/user/login")
//                .excludePathPatterns("/user/sendMailForget")
//                .excludePathPatterns("/user/checkLoginRole")
//                .excludePathPatterns("/phone/selectAllPhones")
//                .excludePathPatterns("/phone/selectPhoneById")
//                .excludePathPatterns("/phone/selectSupplierById")
//                .excludePathPatterns("/supplier/selectSupplierById")
//                .excludePathPatterns("/broadband/selectAllBroadband")
//                .excludePathPatterns("/broadband/selectBroadbandById")
//                .excludePathPatterns("/traffic/selectAllTraffic")
//                .excludePathPatterns("/traffic/selectTrafficById");
    }
}